package IMIC.NGUYENVANTINH.ARRAY.EXCERCISE.EX01;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		boolean chk = false;
		while (!chk) {
			double[] arr = new double[2];
			boolean flag = false;
			// khai bao scanner de nguoi dung nhap vao tu ban phim
			Scanner sc = new Scanner(System.in);
			System.out.println("Nhap danh sach cac phan tu: ");
			while (!flag) {
				try {
					for (int i = 0; i < arr.length; i++) {
						System.out.print("Điểm " + (i + 1) + " ");
						arr[i] = sc.nextDouble();
						flag = true;
					}
				} catch (Exception e) {
					// TODO: handle exception
					System.out.println("Ban phai nhap vao kieu double...");
					sc.nextLine();
				}
			}
			Controllers ctrl = new Controllers();
			System.out.print("Below Average : " + ctrl.CheckAVG(arr, 0) + "\n");
			System.out.print("Medium score :" + ctrl.CheckAVG(arr, 1) + "\n");
			System.out.print("Points on Average : " + ctrl.CheckAVG(arr, 2) + "\n");
			System.out.println("You enter number 1 to exit...");
			int q = 0;
			q = sc.nextInt();
			if (q == 1) {
				chk = true;
				System.out.println("Exit successfull...");
			}
			
		}

	}

}
